package com.zdft.promotion.transfers.dto;

import java.io.Serializable;

public class RestfulDto implements Serializable {
    private static final long serialVersionUID = -1307878367865339626L;
    /**
     * 返回码：请求成功
     */
    public static final String SUCCESS = "0";
    public static final String FAIL = "-1";

    private String code;
    private String message;
    private Object object;

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public Object getObject() {
        return object;
    }

    public void setObject(Object object) {
        this.object = object;
    }

    /**
     * 成功结果构造方法
     */
    public RestfulDto() {
        this(null);
    }

    /**
     * 成功结果构造方法
     *
     * @param object 参数
     */
    public RestfulDto(Object object) {
        this(SUCCESS, "success", object);
    }

    /**
     * 失败结果构造方法
     *
     * @param code    结果编码
     * @param message 结果信息
     */
    public RestfulDto(String code, String message) {
        this(code, message, null);
    }

    /**
     * 结果构造方法
     *
     * @param code    结果编码
     * @param message 结果信息
     * @param object  参数
     */
    public RestfulDto(String code, String message, Object object) {
        this.code = code;
        this.object = object;
        this.message = message;
    }
}
